export const changeTypeList = [
	{
		text: '支出',
		value: 'expend',
	}, {
		text: '收入',
		value: 'income',
	},
]
export const eventRules = {
	eventName: {
		rules: [
			{
				required: true,
				errorMessage: '事务名称不能为空'
			},
			{
				maxLength: 10,
				errorMessage: '事务名称不能超过10位'
			}
		]
	},
	amount: {
		rules: [{
			required: true,
			errorMessage: '金额不能为空'
		}, {
			validateFunction: (_ : any, value : number, d : any, callback : (val : string) => void) => {
				if (!value) {
					return true;
				}
				if (value < 0.01) {
					callback('金额不能低于0.01')
					return false;
				}
				const str = String(value);
				const index = str.indexOf('.');
				if (index !== -1 && index < str.length - 3) {
					callback('金额小数位不能超过两位')
					return false;
				}
				return true
			}
		},
		]
	}
}